<?php
// +----------------------------------------------------------------------
// | ThinkCMF [ WE CAN DO IT MORE SIMPLE ]
// +----------------------------------------------------------------------
// | Copyright (c) 2013-2019 http://www.thinkcmf.com All rights reserved.
// +----------------------------------------------------------------------
// | Licensed ( http://www.apache.org/licenses/LICENSE-2.0 )
// +----------------------------------------------------------------------
// | Author: Powerless < wzxaini9@gmail.com>
// +----------------------------------------------------------------------
namespace app\api\controller;


use cmf\controller\RestBaseController;
use think\Db;
use app\api\model\GoodsModel;

class IndexController  extends RestBaseController

{

    /**
     * 前台用户首页(公开)
     */
    public function index()
    {

        $model = new GoodsModel();
        $field = 'id,post_title,thumbnail,price';
        $goodsList = $model->goods_list('',$field );
        $this->success("获取成功!", ['goodsList '=>$goodsList]);
    }
    public function banben(){
        $banbenhao = input('banbenhao',0);
        if($banbenhao == '1.1.3'){
            $this->success('版本正确');
        }else{
            $this->error('版本错误',['dizhi'=>'http://ony-plus.test.upcdn.net/RooWallet-1.1.3.apk']);
        }
    }
    public function config(){
        $model = new GoodsModel();
        $configInfo = $model->get_config();
        $this->success("获取成功!", ['configInfo '=>$configInfo]);
    
    }
    public function tagList(){
        $model = new GoodsModel();
        $tagList = $model->tag_list('','id,create_time,name');
        $this->success("获取成功!", ['tagList '=>$tagList]);
    }
     public function tagInfo(){
        $id = input('id');
        $model = new GoodsModel();
        $tagInfo = $model->tagInfo(['id'=>$id],'id,create_time,name,content');
        $this->success("获取成功!", ['tagInfo '=>$tagInfo]);
    }


}
